﻿using System;

namespace ExpressionMapper
{
    public static class TypeExtensions
    {
        public static string GetGenericTypeName(this Type t)
        {
            if( t == null)
                throw new ArgumentNullException("t", "Parameter cannot be null");

            if(t.IsGenericType)
                return t.Name.Substring(0, t.Name.Length - 2);

            return t.Name;
        }
    }
}
